<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>箭头函数的参数</title>
</head>

<body>
  <script>
    // 箭头函数没有动态参数,只有剩余参数
    const getSum = (...arr) => {
      let sum = 0
      for (let i = 0; i < arr.length; i++) {
        sum += arr[i]
      }
      console.log(sum);
      return sum
    }
    const sum = getSum(1, 2, 3)
    console.log(sum);

  </script>
</body>

</html>